import java.util.Vector;
import java.util.Collections;
import java.util.Comparator;

public class PopulationContainer
{

	private Vector<Population> container;

	public PopulationContainer(Vector<Population> container)
	{
		super();
		this.container = container;
	}

	public PopulationContainer()
	{
		this.container = new Vector<Population>(1000);
	}

	public void add(Population dp)
	{
		container.add(dp);
	}

	public Population get(int index)
	{
		return container.get(index);
	}

	public int size()
	{
		return container.size();
	}

	public void clear()
	{
		container.clear();	
	}	
	
	public void quickSort()
	{
		Collections.sort(container);		
	}

	public boolean partialInclude(Population dp)
{
		boolean res = false;
		for (int i = 0; i < size(); i++)
		{
			if (dp.isIncludeIn(get(i)))
			{ // Si on tombe sur deux populations egales.
				if (!res)
				{
					dp.display();
					System.out.print(" est inclus dans ");
					get(i).display();
					System.out.println();
				}
				if (dp.size() != get(i).size())
					res = true;
			}
		}
	return res;
}

public void display()
{
	for (int i = 0; i < size(); i++)
	{
		get(i).display();
		System.out.println();
	}
}

}
